home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / bw2reg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-03  |  3.1 KB  |  98 lines

  1. /* @(#)bw2reg.h 1.12 88/02/08 SMI */
  2.  
  3. /*
  4.  * Copyright 1985, 1987 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    bw2reg_DEFINED
  8. #define    bw2reg_DEFINED
  9.  
  10. /*
  11.  * Monochrome memory frame buffer hardware definitions
  12.  */
  13.  
  14. #define    BW2_FBSIZE        (128*1024)    /* size of frame buffer */
  15. #define    BW2_FBSIZE_HIRES    (256*1024)    /* hi-res frame buffer size */
  16.  
  17. #define BW2_USECOPYMEM        0x1    /* config flag to use copy memory */
  18.  
  19. #ifdef KERNEL
  20.  
  21. #define    BW2_COPY_MEM_AVAIL    (defined(sun2) || defined(SUN3_160))
  22.  
  23. #ifdef SUN3_60
  24. /* on-board frame buffer resolution jumper -- Sun-3/60 only */
  25. #define    BW2_RES_SENSE_ADDR    0xFF1C0000    /* resolution jumper address */
  26. #define    BW2_RES_SENSE_PGT    PGT_OBMEM    /* address space */
  27. #define    BW2_RES_SENSE_LOWRES    0x80        /* "low resolution" bit */
  28. #endif SUN3_60
  29.  
  30. #endif KERNEL
  31.  
  32. /*
  33.  * Sun-2 definitions
  34.  */
  35.  
  36. /*
  37.  * The Sun-2 video lives in P2 memory space (BW2MB) or is onboard
  38.  * (BW2VME); we can access it through either:
  39.  *    the identical virtual addresses established by the monitor
  40.  *    the physical address appropriate to the type.
  41.  * The video memory is just memory, although it can also copy data that
  42.  * is written to other locations.
  43.  * The A-side of the MB_ZSCC connects to the keyboard.
  44.  * The B-side of the MB_ZSCC connects to the mouse.
  45.  */
  46.  
  47. #define    BW2MB_FB    (char *)0x700000    /* frame buffer */
  48. #define    BW2MB_ZSCC    (char *)0x780000    /* UARTS */
  49. #define BW2MB_CR    (char *)0x781800    /* video control register */
  50. #define BW2MB_PGT        PGT_OBMEM
  51.  
  52. #define BW2VME_FB    (char *)0x000000
  53. #define BW2VME_CR    (char *)0x020000
  54. #define BW2VME_PGT        PGT_OBIO
  55.  
  56. /*
  57.  * The video control register is arranged as shown below.
  58.  *
  59.  * Vc_copybase specifies the base (physical) address in main memory
  60.  * where, if a write is done, the write is also done to the frame buffer.
  61.  * Note that copying only works on 128K boundaries even though the base
  62.  * address is specified in 64K units, since the low order bit is ignored.
  63.  */
  64. struct    bw2cr {
  65.     unsigned vc_video_en:1;        /* Video enable */
  66.     unsigned vc_copy_en:1;        /* Copy enable */
  67.     unsigned vc_int_en:1;        /* Interrupt enable */
  68.     unsigned vc_int:1;        /* Int active - r/o */
  69.     unsigned vc_b_jumper:1;        /* Config jumper, 0=default */
  70.                     /* FIXME: 1=manufacturing burnin */
  71.                     /* This is a 'temporary' kludge */
  72.     unsigned vc_a_jumper:1;        /* Config jumper, 0=default */
  73.     unsigned vc_color_jumper:1;    /* Config jumper, 0=default */
  74.                     /* 1=use S-2 color as console */
  75.     unsigned vc_1024_jumper:1;    /* Config jumper, 0=default */
  76.                     /* 1=screen is 1024*1024 */
  77.     /* NOTE: vc_copybase & 0x81 == aberrant bits. Don't depend on 'em! */
  78. #define    weird    1
  79.     unsigned vc_copybase:weird+6+weird;    /* Base addr of copy memory */
  80. #undef    weird
  81. };
  82.  
  83. #define BW2_COPYSHIFT    16        /* bits to shift base address */
  84.  
  85. #define BW2_VIDEOENABLEMASK     0x8000  /* Video enable */
  86. #define BW2_COPYENABLEMASK      0x4000  /* Copy enable */
  87. #define BW2_INTENABLEMASK       0x2000  /* Interrupt enable */
  88. #define BW2_INTACTIVEMASK       0x1000  /* Interrupt active */
  89. #define BW2_COPYBASEMASK        0x007E  /* Copy base */
  90.  
  91. /* the Sun-2 bwtwo device, as mapped in the kernel */
  92. struct    bw2dev {
  93.     u_char    image[BW2_FBSIZE];
  94.     struct bw2cr bw2cr;
  95. };
  96.  
  97. #endif bw2reg_DEFINED
  98.